package main.Q2101_2200;

public class Q2161_2170 {
    public static void main(String[] args) {
        System.out.println("Question2161：根据给定数字划分数组");
        System.out.println("Question2162：");
        System.out.println("Question2163：");
        System.out.println("Question2164：");
        System.out.println("Question2165：");
        System.out.println("Question2166：");
        System.out.println("Question2167：");
        System.out.println("Question2168：");
        System.out.println("Question2169：");
        System.out.println("Question2170：");
    }
}

class Question2161 {
    public int[] pivotArray(int[] nums, int pivot) {
        int[] result = new int[nums.length];
        int index = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] < pivot) {
                result[index++] = nums[i];
            }
        }
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == pivot) {
                result[index++] = nums[i];
            }
        }
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] > pivot) {
                result[index++] = nums[i];
            }
        }
        return result;
    }
}